﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace GeoWeb.Demo.UploadFileWebService
{
    public class UploadLog
    {

        public UploadLog()
        { 
            
        }
        public UploadLog(string fileName, uint fileSize, int appendSize, string fileSavePath, string userName, DateTime opTime)
        {
            Status = 0;
            FileName = fileName;
            FileSize = fileSize;
            CurrentSize += appendSize;
            FileSavePath = fileSavePath;
            UserName = userName;
            OPTime = opTime;
        }

        public static UploadLog operator +(UploadLog u1, int append)
        { 
            u1.CurrentSize += append;
            return u1;
        }

        public string FileName
        {
            get;
            set;
        }
        public uint FileSize
        {
            get;
            set;
        }
        private int currentSize;
        public int CurrentSize
        {
            get { return currentSize; }
            set
            {
                currentSize = value;
                if (value >= FileSize)
                {
                    Status = 1;
                }
            }
        }
        public string FileSavePath
        {
            get;
            set;
        }
        public DateTime OPTime
        {
            get;
            set;
        }
        public string UserName
        {
            get;
            set;
        }
        /// <summary>
        /// 1:Over  
        /// 0:Suspend
        /// </summary>
        public int Status { get; set; }

    }
}
